﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections;



    public class NHACUNGCAP_BUSSINESS
    {
        public DataSet GETNCC(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "LIST";
        return NHACCUNGCAP_DATAACCESS.GETDATATABLE(ACTION, NCC);
    }
    public DataSet TTNHACUNGCAP(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "GETBYMANHACUNGCAP";
        return NHACCUNGCAP_DATAACCESS.GETDATATABLE(ACTION, NCC);
    }
    public void THEMNHACUNGCAP(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "INSERT";
        NHACCUNGCAP_DATAACCESS.ExcuteQueryString(ACTION, NCC);
    }
    public void SUANHACUNGCAP(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "UPDATE";
        NHACCUNGCAP_DATAACCESS.ExcuteQueryString(ACTION, NCC);
    }
    public void LUUNHACUNGCAP(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "SAVE";
        NHACCUNGCAP_DATAACCESS.ExcuteQueryString(ACTION, NCC);
    }
    public void XOANHACUNGCAP(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "DELETE";
        NHACCUNGCAP_DATAACCESS.ExcuteQueryString(ACTION, NCC);
    }
    public Hashtable HashListNHACUNGCAP(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "LIST";
        Hashtable ht = new Hashtable();
        DataSet ds = NHACCUNGCAP_DATAACCESS.GETDATATABLE(ACTION, NCC);
        if (ds.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                ht.Add(dr["MANCC"], dr["TENNCC"]);
            }
        }
        return ht;
    }
    //kiem tra ma NCC
    public DataSet HashListMANCC(NHACUNGCAP_ENTITY NCC)
    {
        string ACTION = "LIST";
        Hashtable ht = new Hashtable();
        // DataSet ds =
        return NHACCUNGCAP_DATAACCESS.GETDATATABLE(ACTION, NCC);


    }
}
        
   
 
